<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsSnapshotTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //商品快照表
        Schema::create('goods_snapshot', function(Blueprint $table) {
            $table->increments('id')->comment('自增id');
            $table->integer('goods_id')->default(0)->comment('商品id');
            $table->string('ssn',20)->nullable()->comment('商品货号');
            $table->string('name',50)->comment('商品名称');
            $table->decimal('m_price')->default(0)->comment('市场价格');
            $table->decimal('s_price')->default(0)->comment('销售价格');
            $table->integer('thumb_id')->default(0)->comment('商品缩略图');
            $table->text('info')->nullable()->comment('商品信息描述');
            $table->integer('sale_count')->default(0)->comment('销售数量');
            $table->string('type')->nullable()->comment('common:常规商品;integral:积分商品');
            $table->integer('exchange_integral')->default(0)->comment('兑换积分');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
